// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLAlterTableUnarchivePartition.h"
#include "../../visitor/SQLASTVisitor.h"
#include "SQLAssignItem.h"
#include "../../../utils/listTran.h"

SQLAlterTableUnarchivePartition::SQLAlterTableUnarchivePartition()
{
  partitions = std::make_shared<std::list<SQLAssignItem_ptr>>();
}

SQLAssignItem_list_ptr SQLAlterTableUnarchivePartition::getPartitions()
{
  return partitions;
}

void SQLAlterTableUnarchivePartition::addPartition(SQLAssignItem_ptr partition)
{
  if (partition != nullptr)
  {
    partition->setParent(SharedObject(SQLAlterTableUnarchivePartition));
  }
  this->partitions->push_back(partition);
}

// @Override
void SQLAlterTableUnarchivePartition::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableUnarchivePartition)))
  {
    SQLObject_list_ptr tmp = ListTran::tran_class<SQLAssignItem, SQLObject>(partitions);
    acceptChild(visitor, tmp);
  }
  visitor->endVisit(SharedObject(SQLAlterTableUnarchivePartition));
}
